package service.impl;

import bean.dto.VehicleChangeData;
import bean.pojo.ParkingSpace;
import bean.vo.ParkingInfo;
import dao.ParkingSpaceDao;
import dao.impl.ParkingSpaceDaoImpl;
import service.ParkingSpaceService;

import java.util.List;

/**
 * bean.pojo.vehicle
 * User: 坚持
 * Date: 2024/12/18 11:34
 * motto: 树欲静而风不止
 * Description:
 * Version: V1.0
 */

public class ParkingSpaceServiceImpl implements ParkingSpaceService {
    ParkingSpaceDao parkingSpaceDao = new ParkingSpaceDaoImpl();
    @Override
    public Boolean updateParkingSpace(VehicleChangeData vehicleChangeData) {
        return parkingSpaceDao.updateParkingSpace(vehicleChangeData)>0;
    }

    @Override
    public Boolean update(ParkingSpace parkingSpace) {
        return parkingSpaceDao.update(parkingSpace)>0;
    }

    @Override
    public Long findByTotal(Integer ownerVehicleId,Integer parkingVehicleId) {
        return parkingSpaceDao.findByTotal( ownerVehicleId, parkingVehicleId);
    }

    @Override
    public List<ParkingInfo> findBy(Integer page, Integer limit, Integer ownerVehicleId, Integer parkingVehicleId) {
        return parkingSpaceDao.findBy(page,limit,ownerVehicleId, parkingVehicleId);
    }
}
